#encoding:utf-8

import time

def twoSum(nums, target) :
    dict = {}
    for i in range(len(nums)):
        if target - nums[i] not in dict:
            dict[nums[i]] = i
        else:
            return [dict[target - nums[i]], i]

    # for i in range(len(nums)):
    #     for j in range(len(nums)):
    #         if target-nums[i] == nums[j]:
    #             return [i,j]

start = time.perf_counter()

print(twoSum([2,7,11,15],9))


end = time.perf_counter()

print(time.process_time())
print(end-start)
# print(time.process_time_ns())